$(document).ready(function() {
	
	var id = "alunoDataGrid";
	var url = "pessoases/bServerSideHql";	
	var aoColumns = [
            { "sTitle": "Nome", "mDataProp": "nome", "sClass": "right", "bVisible": true , "sDefaultContent":""},
            { "sTitle": "Mãe", "mDataProp": "mae", "sClass": "right", "bVisible": true , "sDefaultContent":""},
            { "sTitle": "Pai", "mDataProp": "pai", "sClass": "right", "bVisible": false , "sDefaultContent":""},
            { "sTitle": "Celular", "mDataProp": "celular", "sClass": "right", "bVisible": true , "sDefaultContent":""},
            { "sTitle": "Telefone", "mDataProp": "telefone", "sClass": "right", "bVisible": true , "sDefaultContent":""},
            { "sTitle": "Data de nascimento", "mDataProp": "nascimento","sType":"date", "sClass": "right", "bVisible": false , "sDefaultContent":""},
            {"sTitle": "Opções", "mDataProp": "htmlControl","bSortable": false, "bVisible": true, "sWidth": "45px","sDefaultContent":"", 
				   "fnRender": function ( oObj ) {
						
//					   var botao = "";	                     					   
//					   if(oObj.aData.despachar){
						   botao = "<button type=\"button\" class=\"editarBtn"+id+"\" onclick=\"recebePessoa(event,'"+id+"')\">Escolher aluno</button>";
//					   }
					   //botao+= "<button type=\"button\" class=\"magnifierGlassDataGridBtn"+id+"\" onclick=\"loadDespacho(event, '"+oObj.aData.id+"')\">Vizualizar despachos</button>";
					   //botao+= "<button type=\"button\" class=\"printBtn"+id+"\" onclick=\"imprimir(event, '"+oObj.aData.id+"')\">Imprimir Solicitação</button>";
					   return  botao;
				}
			}
    ];
	data = new Date();
	dia = data.getDate();
	mes = data.getMonth();
	ano = data.getFullYear();
	table = 	" Pessoas as o, Alunos as a  ";
	where = " where a.pessoaAluno = o.id and o.isStudent = true";
	classe = "br.com.educa.modelo.pessoa.Pessoas";
	arrString = 	JSON.stringify(aoColumns, function(key, val) {if (typeof val === 'function') { return val + '';} return val;});
	listServerSide(id, url, table, where,classe, arrString);
	
	
});